import unittest
import logging

from google.appengine.api import memcache



import google.appengine.ext.db as db

#try:
#  from google.appengine.tools import dev_appserver
#  dev_appserver.SetupStubs('SuperApp',
#                          login_url="foo",
#                          datastore_path="/dev/null",
#                          history_path="/dev/null",
#                          clear_datastore=False)
#except ImportError, exc:
#  logging.info("running on cloud", exc_info=True)



class Song(db.Model):
  composer = db.StringProperty()

class Bar(db.Model):
  name = db.StringProperty()

class Foo(db.Model):
  name = db.StringProperty()
  bar = db.ReferenceProperty(Bar)




#class DatastoreTest(unittest.TestCase):
#
#  def setUp(self):
#    self.create_entities()
#
#  def create_entities(self):
#    b = Bar()
#    b.name = "I'm bar"
#    b.put()
#
#
#    f = Foo(name="FooManChoo", bar=b)
#    f.put()
#
#
#  def test_look_up(self):
#    f = Foo.all().get()
#    n = f.name
#    logging.debug("my name: foo "+ n)
#    f.bar
#    self.assertEquals("what", f.bar.name)
#
#  def test_look_up2(self):
#    f = Foo.all().get()
#    n = f.name
#    logging.debug("my name: foo "+ n)
#    f.bar
#    self.assertEquals("what", f.bar.name)
#
#
#  def delete_bar(self):
#    Bar.all().get().delete()
#
#
